<?php
//$Task_id = $_POST['task_id'] ?? "";
$Task_name =$_POST['task_name'] ?? "";
$Task_sm = $_POST['task_sm'] ?? "";

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");

$sql = "insert into Task(TaskName,TaskContent)
        values ('{$Task_name}','{$Task_sm}')";
$result = $db->query($sql);

if ($result){
    echo "添加成功请前往<a href='list.php'>查看</a>";
}else{
    echo "添加失败";
}
